A block that makes the selected sprite "shake" with a given intensity can be made with the following code:

If you are not interested in using hyperblocks, you could use the following instead:

Credit

This tutorial was adapted from a forum topic by supersean12 where sombrero shared the hyperblocks version as well.